﻿<%@ Page Title="" Language="C#" MasterPageFile="~/master/m.master" %>

<script runat="server">

</script>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    <style>
        .pageControl{
	position: absolute;
	bottom: 0;
	left: 0;
	width: 100%;
	background: #fff;
	z-index: 2;
}
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="main" Runat="Server">
    <div class="btns-container">
        <button type="button" id="button1" class="" data-toggle="modal" data-target="">
              	<i class="fa fa-upload"></i>&nbsp;&nbsp;导入</button>
    </div>
    <div class="right-content-box">
				<div class="ibox-content">
		            <table class="footable table table-stripped table-list">
						<thead>

						</thead>
						<tbody id="pageList"></tbody>
					</table>
				</div>
			</div>
    <div class="pageControl"></div>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="footer" Runat="Server">
    <script src="../assets/js/page/pageControl.js"></script>
    <script src="../assets/js/page/tableControl.js"></script>
    <script type="application/javascript">
        $(document).ready(function () {
            $('#button1').click(function () {
                Y.API2('BasShop', 'ImportExcel', {}, function (data) {
                    if (data.Success == false) {
                        swal(data.Message, '', 'error');
                    } else {
                        swal(data, '', 'success');
                    }
                })
            })
            var page = 1;
            var loadPageList = function (deptId, needLayer) {
                if ($('.footable thead').children().size() == 0)
                    tableControl.initThead2('.footable', ['门店名称', '门店全称', '操作地区', '所在地区', '股票代号', '地址']);

                pageControl.init('BasShop', 'GetList', {
                    Page: page,
                    Size: 5,
                    needLayer: needLayer,
                    alwaysCallBack: function () {
                        uId = 0;
                        //$('#editBtn').attr('disabled', 'disabled');
                        //$('#deleteBtn').attr('disabled', 'disabled');
                        $('#pageList').empty();
                    }
                }, function (result) {
                    page = result.page;
                    var tBody = [];
                    if (!Y.checkNull(result.data)) {
                        if (result.data.Items.length > 0) {
                            result.data.Items.map(function (item, i) {
                                var tempTr = {
                                    trClass: (i % 2 == 0 ? 'gradeX footable-even' : 'gradeX footable-odd'),
                                    children: [
										{ tdText: item.ShopID, c: 0, r: 0, tdHtml: '', tdId: '', tdClass: 'hide' },
										{ tdText: (item.ShopName || ' '), c: 0, r: 0, tdHtml: '', tdId: '', tdClass: '' },
										{ tdText: (item.ShopFullName || ' '), c: 0, r: 0, tdHtml: '', tdId: '', tdClass: '' },
										{ tdText: (item.OperationAreaID || ' '), c: 0, r: 0, tdHtml: '', tdId: '', tdClass: '' },
										{ tdText: (item.AreaID || ' '), c: 0, r: 0, tdHtml: '', tdId: '', tdClass: '' },
										{ tdText: (item.StockID || ' '), c: 0, r: 0, tdHtml: '', tdId: '', tdClass: '' },
                                        { tdText: (item.Address || ' '), c: 0, r: 0, tdHtml: '', tdId: '', tdClass: '' },
                                    ]
                                };
                                tBody.push(tempTr);
                            })
                        }
                        //rScroll();
                    }
                    tableControl.initTbody('.footable', (tBody.length > 0 ? tBody : null), 7, null);
                });
            }

            loadPageList();
        });
    </script>
</asp:Content>



